<% table = table.renderer(self) %>

<div class="table-container">
  <%= tag.table(id: table.id, class: table.classes, data: table.data) do %>
    <% if table.header? %>
    <thead>
      <tr>
        <% table.columns.each do |column| %>
          <%= tag.th(column.header, class: column.classes, data: column.data) %>
        <% end %>
      </tr>
    </thead>
    <% end %>

    <tbody>
      <% collection.each do |instance| %>
        <%= table.row.render(instance) %>
      <% end %>
    </tbody>
  <% end %>
</div>
